import request from '@/utils/request'
//封装月卡列表接口
export function getCardListAPI(params) {
  return request({
    url: '/parking/card/list',
    method:'get',
    params

  })
}

/**
 * 新增月卡
 * @data
 * @returns
 */
export function createCardAPI(data) {
  return request({
    url: '/parking/card',
    method: 'POST',
    data
  })
}

/**
 * 获取月卡详情
 * @data
 * @returns
 */
export function getCardDetailAPI(id) {
  return request({
    url: `/parking/card/detail/${id}`
  })
}

// PUT
// https://api-hmzs.itheima.net/api/parking/card/edit
/**
 * 获取月卡详情
 * @data
 * @returns
 */
export function updateCardAPI(data) {
  return request({
    url: `/parking/card/edit`,
    method: 'put',
    data
  })
}

/**
 * 删除月卡详情
 * @data
 * @returns
 */
export function delCardAPI(id) {
  return request({
    url: `/parking/card/${id}`,
    method: 'delete'
  })
}
/**
 * 批量删除月卡详情
 */
// export function delCardListAPI(idList){
//   return request({
//     url:`/parking/card/$(idList.join(','))`,
//     method:'delete',
    
//   })
// }